Skip to main content

WebSocketStatus

WebSocketStatus

The WebSocketStatus component is a React component that displays the status of the WebSocket connection. It uses the useSelector hook from react-redux to access the messages from the Redux store and displays them in a list.

Usage

import WebSocketStatus from './WebSocketStatus';

const MyComponent = () => {
return (
<div>
<WebSocketStatus />
{/* Other content */}
</div>
);
};

Props

This component does not accept any props.

Styling

The component does not have any specific styling, but the font size of the message list is set to .3em using inline styles.

Notes

  • This component requires the websocket reducer to be set up in the Redux store.
  • The websocket reducer should contain an array of WebsocketMessage objects, each with a type and payload property.
  • The component differentiates between ERROR messages and other messages, displaying them with different formatting.